﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Infrastructure;
using Data;

namespace BusinessLogic
{
    public class BooksBLL
    {

        public IEnumerable<Book> GetAllBooksByAuthor(Person author)
        {
            BooksDAO da = new BooksDAO();

            var query = from book in da.GetAllBooksFromStorage()
                        where book.Author.FirstName == author.FirstName &&
                              book.Author.LastName == author.LastName  
                        select book;

            var results = query.ToArray();

            return results;


        }
    }
}
